Eli PHP Tutorial

PHP Programming Part 1: Introduction to PHP Programming

1. How does Eli describe PHP?

Eli describe PHP as a programming language that makes a website useful; which allow users to interrelate with data and dynamically write webpages.

2. Briefly compare and contrast scripted and compiled languages.

Scripted languages upload text files unto a server which can be access by the user, the software will process given information and deliver it to the user, while, compiled languages used software that execute the output of the file which cannot be edited.

3. Briefly explain the difference between client side and server side scripting.

At the client side the user gain access to the server, meanwhile, all of the information were sent back to the users PC by the server that kept the informations. The server side process data from the web server and output HTML to the users.

4. What popular website does Eli cite as an example of what you can do with PHP and MySQL? Why did Eli that that this particular site was a good example?

The example will be craiglists.com; because, it does not contain too many graphical elements that make a webpage look pretty and it is intensively useful.

5. What does Eli emphasize as the 'nice' thing about scripted languages such as PHP?

Eli emphasize that text file always in use which the source file can always be read.

6. What is notepad++? Why would Eli recommend notepad++?

Notepad++ is a text editor and source code editor for use with Microsoft Windows; because it contain additional code writing features unlike regular notepad.

7. If you want to write and run PHP code, what do you need?

I will need a notepad and a server that has PHP program installed.

8. How does Eli describe syntax?

Eli describe syntax as how someone spell the commands they using.

Eli's Notepad

PHP Programming Part 2 : PHP Syntax and Errors

1. In a Linux context, does capitalization matter?

Absolutely, yes.

2. What are the basic attributes of PHP syntax?

Start PHP with . Between the tags, create a command such as print or echo and follow it with quotation marks around what you want your output comes out, and end it with a semicolon command.

3. Discuss one of the PHP error handling techniques that Eli presents.

The web browser print out the error in the file telling or indicating either before or after which line containing the error.

4. What is the difference between printing text and printing HTML?

The difference between printing text and printing HTML is that tags are reads by web browser and html codes, and text is prints out with PHP.

5. What happens if you add a PHP script to a HTML page and you do not change the file type to .php from .html?

What will happens is that it does matter at the users level and at the sever level is not really that matter.

PHP Programming Part 3: Comments and INCLUDE in PHP Programming

1. What are the three ways that you can make comments in PHP?

//, # for single line comment and /* */ for multi line comment

2. What is the PHP include function? Why is it useful?

PHP include function have the ability to copy and paste text file from one file location to another. It is useful because it help to save time, transfer information without rewriting.

Include Function Sample

PHP Programming Part 4: Variables in Print in PHP Programming

1. What are the three types of PHP variables that Eli discusses?

The three types of PHP variables Eli discusses are arrays, strings and integers.

2. What naming rules apply to PHP variables?

The variable start with the dollar sign ($) followed by variable name which must start with a letter or the underscore character.

3. Compare and contrast the html 'br' tag in HTML and the '\n' in PHP.

The 'br' tag in HTML, break will be seen in HTML web browser and '\n' in PHP the break will be seen in the text source code.

PHP Programming Part 5: HTML Forms and PHP Programming

1. What does it mean when Eli says that HTML creates static pages while PHP creates dynamic pages?

It means that HTML creates forms and its objects; this form will go through PHP to get it work perfectly. PHP writes or grabs information to/from a file and make it useful.

2. In this exercise, you will use an HTML Textbox, an Option Box, and a Radio Button. What function does each of these input methods provide?

The HTML textbox enable users to input text string up to the size attribute, an option box let users select from a predefined list. CTRL key can be utilize by the users for multiple selection choices if correctly setup. The radio button only allow users to select a choice from predefined list. The label attribute make selection more user friendly activating the selection when text clicked.

Eli's Shirt Size Form

PHP Programming Part 6: Printing to Files with PHP

1. In this example, you use the PHP file_put_contents() function. Briefly describe this function. Hint: Consult W3Schools or the PHP manual.

This particular function writes information which was given to a file.

2. What is a CSV file? Why would you want to use one?

It is comma separated value text file format, a spreadsheet format. To open any spreadsheet program and saved it as an excel file to be email.

Eli's Email Form